/*
 Navicat Premium Data Transfer

 Source Server         : 192.168.1.252
 Source Server Type    : MySQL
 Source Server Version : 50736
 Source Host           : 192.168.1.252:3306
 Source Schema         : xlauch-codegener

 Target Server Type    : MySQL
 Target Server Version : 50736
 File Encoding         : 65001

 Date: 24/05/2023 10:43:53
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for gen_base_class
-- ----------------------------
DROP TABLE IF EXISTS `gen_base_class`;
CREATE TABLE `gen_base_class`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基类包名',
  `code` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基类编码',
  `fields` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '基类字段，多个用英文逗号分隔',
  `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '基类管理' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_base_class
-- ----------------------------
INSERT INTO `gen_base_class` VALUES (1, 'net.maku.framework.common.entity', 'BaseEntity', 'id,creator,create_time,updater,update_time,version,deleted', '使用该基类，则需要表里有这些字段', '2023-05-05 09:13:44');

-- ----------------------------
-- Table structure for gen_datasource
-- ----------------------------
DROP TABLE IF EXISTS `gen_datasource`;
CREATE TABLE `gen_datasource`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `db_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据库类型',
  `conn_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '连接名',
  `conn_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'URL',
  `username` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名',
  `password` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '数据源管理' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_datasource
-- ----------------------------
INSERT INTO `gen_datasource` VALUES (3, 'MySQL', '本地', 'jdbc:mysql://localhost:3306/i84_admin?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&useSSL=true', 'root', '123456', '2023-05-08 17:07:18');

-- ----------------------------
-- Table structure for gen_field_type
-- ----------------------------
DROP TABLE IF EXISTS `gen_field_type`;
CREATE TABLE `gen_field_type`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `column_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段类型',
  `attr_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性类型',
  `package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性包名',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `column_type`(`column_type`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 32 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '字段类型管理' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_field_type
-- ----------------------------
INSERT INTO `gen_field_type` VALUES (1, 'datetime', 'Date', 'java.util.Date', '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (2, 'date', 'Date', 'java.util.Date', '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (3, 'tinyint', 'Integer', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (4, 'smallint', 'Integer', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (5, 'mediumint', 'Integer', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (6, 'int', 'Integer', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (7, 'integer', 'Integer', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (8, 'bigint', 'Long', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (9, 'float', 'Float', NULL, '2023-05-05 09:13:43');
INSERT INTO `gen_field_type` VALUES (10, 'double', 'Double', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (11, 'decimal', 'BigDecimal', 'java.math.BigDecimal', '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (12, 'bit', 'Boolean', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (13, 'char', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (14, 'varchar', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (15, 'tinytext', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (16, 'text', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (17, 'mediumtext', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (18, 'longtext', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (19, 'timestamp', 'Date', 'java.util.Date', '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (20, 'NUMBER', 'Integer', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (21, 'BINARY_INTEGER', 'Integer', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (22, 'BINARY_FLOAT', 'Float', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (23, 'BINARY_DOUBLE', 'Double', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (24, 'VARCHAR2', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (25, 'NVARCHAR', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (26, 'NVARCHAR2', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (27, 'CLOB', 'String', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (28, 'int8', 'Long', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (29, 'int4', 'Integer', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (30, 'int2', 'Integer', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_field_type` VALUES (31, 'numeric', 'BigDecimal', 'java.math.BigDecimal', '2023-05-05 09:13:44');

-- ----------------------------
-- Table structure for gen_project
-- ----------------------------
DROP TABLE IF EXISTS `gen_project`;
CREATE TABLE `gen_project`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `project_name` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '项目名称',
  `package_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '包名',
  `version` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '版本',
  `backend_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '后端项目路径',
  `frontend_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '前端项目路径',
  `author` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作者',
  `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱地址',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_project
-- ----------------------------
INSERT INTO `gen_project` VALUES (1, 'xlauch-modules-sys', 'com.xlauch', '1.0.0', 'D:\\\\deve\\\\workspace\\\\xlauch\\\\code\\\\xlauch\\\\xlauch-modules\\\\xlauch-modules-sys', 'D:\\\\deve\\\\workspace\\\\xlauch\\\\code\\\\xlauch-ui', '伊凡', 'fxz_2008@139.com', NULL);
INSERT INTO `gen_project` VALUES (3, 'xlauch-modules-deve', 'com.xlauch', '1.0', 'D:\\\\deve\\\\workspace\\\\xlauch\\\\code\\\\xlauch\\\\xlauch-modules\\\\xlauch-modules-deve', 'D:\\\\deve\\\\workspace\\\\xlauch\\\\code\\\\xlauch-ui', '伊凡', 'fxz_2008@139.com', NULL);

-- ----------------------------
-- Table structure for gen_project_modify
-- ----------------------------
DROP TABLE IF EXISTS `gen_project_modify`;
CREATE TABLE `gen_project_modify`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `project_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目名',
  `project_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目标识',
  `project_package` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目包名',
  `project_path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目路径',
  `modify_project_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更项目名',
  `modify_project_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更标识',
  `modify_project_package` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更包名',
  `exclusions` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '排除文件',
  `modify_suffix` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更文件',
  `modify_tmp_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变更临时路径',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目名变更' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_project_modify
-- ----------------------------
INSERT INTO `gen_project_modify` VALUES (1, 'maku-boot', 'maku', 'net.maku', 'D:/makunet/maku-boot', 'baba-boot', 'baba', 'com.baba', '.git,.idea,target,logs', 'java,xml,yml,txt', NULL, '2023-05-05 09:13:44');
INSERT INTO `gen_project_modify` VALUES (2, 'maku-cloud', 'maku', 'net.maku', 'D:/makunet/maku-cloud', 'baba-cloud', 'baba', 'com.baba', '.git,.idea,target,logs', 'java,xml,yml,txt', NULL, '2023-05-05 09:13:45');

-- ----------------------------
-- Table structure for gen_table
-- ----------------------------
DROP TABLE IF EXISTS `gen_table`;
CREATE TABLE `gen_table`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `table_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表名',
  `class_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类名',
  `table_comment` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明',
  `author` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '作者',
  `email` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
  `package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目包名',
  `version` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目版本号',
  `generator_type` tinyint(4) NULL DEFAULT NULL COMMENT '生成方式  0：zip压缩包   1：自定义目录',
  `project_id` bigint(20) NULL DEFAULT NULL COMMENT '所属项目id',
  `backend_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '后端生成路径',
  `frontend_path` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '前端生成路径',
  `module_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模块名',
  `function_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '功能名',
  `form_layout` tinyint(4) NULL DEFAULT NULL COMMENT '表单布局  1：一列   2：两列',
  `datasource_id` bigint(20) NULL DEFAULT NULL COMMENT '数据源ID',
  `baseclass_id` bigint(20) NULL DEFAULT NULL COMMENT '基类ID',
  `group_id` bigint(20) NULL DEFAULT NULL COMMENT '分组id',
  `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `table_name`(`table_name`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_table
-- ----------------------------
INSERT INTO `gen_table` VALUES (3, 't_sys_version', 'SysVersion', '版本', '伊凡', 'fxz_2008@139.com', 'com.xlauch', '1.0.0', 1, 3, 'D:\\\\deve\\\\workspace\\\\xlauch\\\\code\\\\xlauch\\\\xlauch-modules\\\\xlauch-modules-deve', 'D:\\\\deve\\\\workspace\\\\xlauch\\\\code\\\\xlauch-ui', 'sys', 'version', 1, 0, NULL, 1, '2023-05-05 15:57:16');

-- ----------------------------
-- Table structure for gen_table_field
-- ----------------------------
DROP TABLE IF EXISTS `gen_table_field`;
CREATE TABLE `gen_table_field`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `table_id` bigint(20) NULL DEFAULT NULL COMMENT '表ID',
  `field_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段名称',
  `field_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段类型',
  `field_comment` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '字段说明',
  `attr_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性名',
  `attr_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性类型',
  `package_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '属性包名',
  `sort` int(11) NULL DEFAULT NULL COMMENT '排序',
  `auto_fill` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '自动填充  DEFAULT、INSERT、UPDATE、INSERT_UPDATE',
  `primary_pk` tinyint(4) NULL DEFAULT NULL COMMENT '主键 0：否  1：是',
  `base_field` tinyint(4) NULL DEFAULT NULL COMMENT '基类字段 0：否  1：是',
  `form_item` tinyint(4) NULL DEFAULT NULL COMMENT '表单项 0：否  1：是',
  `form_required` tinyint(4) NULL DEFAULT NULL COMMENT '表单必填 0：否  1：是',
  `form_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单类型',
  `form_dict` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单字典类型',
  `form_validator` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '表单效验',
  `grid_item` tinyint(4) NULL DEFAULT NULL COMMENT '列表项 0：否  1：是',
  `grid_sort` tinyint(4) NULL DEFAULT NULL COMMENT '列表排序 0：否  1：是',
  `query_item` tinyint(4) NULL DEFAULT NULL COMMENT '查询项 0：否  1：是',
  `query_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '查询方式',
  `query_form_type` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '查询表单类型',
  `query_dict` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '查询字典类型',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 134 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '代码生成表字段' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_table_field
-- ----------------------------
INSERT INTO `gen_table_field` VALUES (13, 3, 'version_id', 'int', '版本主键', 'versionId', 'Integer', NULL, 0, 'DEFAULT', 1, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (14, 3, 'code', 'varchar', '内部版本编码', 'code', 'String', NULL, 1, 'DEFAULT', 0, 0, 1, 1, 'text', NULL, NULL, 1, 0, 1, 'like', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (15, 3, 'version_no', 'varchar', '发行版本号（对外）', 'versionNo', 'String', NULL, 2, 'DEFAULT', 0, 0, 1, 1, 'text', NULL, NULL, 1, 0, 1, 'like', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (16, 3, 'business_code', 'varchar', '业务代码', 'businessCode', 'String', NULL, 3, 'DEFAULT', 0, 0, 1, 1, 'text', NULL, NULL, 1, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (17, 3, 'content', 'varchar', '更新内容', 'content', 'String', NULL, 4, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 1, 0, 0, 'like', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (18, 3, 'pack_size', 'varchar', '安装包大小', 'packSize', 'String', NULL, 5, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 1, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (19, 3, 'url', 'varchar', '第三方下载页面url', 'url', 'String', NULL, 7, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (20, 3, 'pack_url', 'varchar', '安装包下载地址', 'packUrl', 'String', NULL, 6, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (21, 3, 'app_type', 'int', '类型,1=安卓，2=ios，3=小程序', 'appType', 'Integer', NULL, 8, 'DEFAULT', 0, 0, 1, 1, 'select', 'appType', NULL, 1, 0, 1, '=', 'select', 'app_type');
INSERT INTO `gen_table_field` VALUES (22, 3, 'update_type', 'int', '更新方式,1=强制更新，2=可选更新', 'updateType', 'Integer', NULL, 9, 'DEFAULT', 0, 0, 1, 1, 'select', 'updateType', NULL, 1, 0, 1, '=', 'select', 'app_update_type');
INSERT INTO `gen_table_field` VALUES (23, 3, 'service_url', 'varchar', '请求服务地址，如https://clife.5i84.cn', 'serviceUrl', 'String', NULL, 10, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (24, 3, 'service_vue_url', 'varchar', '请求服务资源地址，如https://cloud.ngrok.i84.com.cn', 'serviceVueUrl', 'String', NULL, 11, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (25, 3, 'service_port', 'varchar', '端口号，如443', 'servicePort', 'String', NULL, 12, 'DEFAULT', 0, 0, 1, 0, 'text', NULL, NULL, 1, 0, 1, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (26, 3, 'env_type', 'int', '环境类型  1=正式服，2=预发布 ，3=测试服', 'envType', 'Integer', NULL, 13, 'DEFAULT', 0, 0, 1, 1, 'select', 'envType', NULL, 1, 0, 1, '=', 'select', 'env_type');
INSERT INTO `gen_table_field` VALUES (27, 3, 'create_user', 'int', '创建人', 'createUser', 'Integer', NULL, 14, 'INSERT', 0, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (28, 3, 'create_name', 'varchar', '创建人名称', 'createName', 'String', NULL, 15, 'INSERT', 0, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, 'left like', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (29, 3, 'create_time', 'datetime', '创建时间', 'createTime', 'Date', 'java.util.Date', 16, 'INSERT', 0, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, 'right like', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (30, 3, 'update_user', 'int', '修改人', 'updateUser', 'Integer', NULL, 17, 'UPDATE', 0, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, '<', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (31, 3, 'update_name', 'varchar', '修改人名称', 'updateName', 'String', NULL, 18, 'UPDATE', 0, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, '>=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (32, 3, 'update_time', 'datetime', '修改时间', 'updateTime', 'Date', 'java.util.Date', 19, 'UPDATE', 0, 0, 0, 0, 'datetime', NULL, NULL, 0, 0, 0, '=', 'text', NULL);
INSERT INTO `gen_table_field` VALUES (33, 3, 'delete_flag', 'int', '是否删除 1正常 2删除', 'deleteFlag', 'Integer', NULL, 20, 'INSERT', 0, 0, 0, 0, 'text', NULL, NULL, 0, 0, 0, '=', 'text', NULL);

-- ----------------------------
-- Table structure for gen_template
-- ----------------------------
DROP TABLE IF EXISTS `gen_template`;
CREATE TABLE `gen_template`  (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `group_id` bigint(20) NOT NULL COMMENT '分组id',
  `template_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模板名称',
  `simple_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注名称',
  `generator_path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件名称',
  `template_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '模板内容',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_template
-- ----------------------------
INSERT INTO `gen_template` VALUES (1, 1, 'Controller.java.ftl', 'Controller', '${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java', 'package ${package}.${moduleName}.controller;\n\nimport lombok.AllArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport cn.dev33.satoken.annotation.SaCheckPermission;\nimport com.xlauch.base.common.controller.BaseController;\nimport com.xlauch.base.common.res.R;\nimport com.xlauch.base.common.vo.Ids;\nimport com.xlauch.base.datasource.bean.Pager;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n\n/**\n* 类描述 : ${tableComment}\n*\n* @author ${author}\n* @version ${version}\n* @since ${date}\n*/\n@Slf4j\n@RestController\n@RequestMapping(\"${moduleName}/${className}\")\n@AllArgsConstructor\npublic class ${ClassName}Controller extends BaseController {\n\n    /**\n     * ${tableComment}服务类\n     */\n    private final ${ClassName}Service ${className}Service;\n\n    /**\n     * 分页查询\n     *\n     * @param pager 分页信息\n     * @return\n     */\n    @PostMapping(\"/list\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:list\")\n    public R list(Pager pager) {\n        return ${className}Service.select${ClassName}List(pager);\n    }\n\n    /**\n     * 新增\n     *\n     * @param ${className} ${tableComment}实体类\n     * @return\n     */\n    @PostMapping(\"/add\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:add\")\n    public R add(@RequestBody ${ClassName} ${className}) {\n        return ${className}Service.insertOrUpdate(${className});\n    }\n\n    /**\n     * 修改\n     *\n     * @param ${className} ${tableComment}实体类\n     * @return\n     */\n    @PostMapping(\"/edit\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:edit\")\n    public R edit(@RequestBody ${ClassName} ${className}) {\n        return ${className}Service.insertOrUpdate(${className});\n    }\n\n    /**\n     * 删除\n     *\n     * @param ids 存放要删除的对象id\n     * @return\n     */\n    @PostMapping(\"/delete\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:delete\")\n    public R delete(@RequestBody Ids ids) {\n        return R.ok(${className}Service.removeBatchByIds(ids.getIdList()));\n    }\n\n}');
INSERT INTO `gen_template` VALUES (2, 1, 'java/Service.java.ftl', 'service', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java', 'package ${package}.${moduleName}.service;\n\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.base.common.res.R;\nimport ${package}.base.datasource.bean.Pager;\nimport ${package}.base.datasource.service.BaseService;\n\n\n/**\n * 类描述 : ${tableComment}服务类接口\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\npublic interface ${ClassName}Service extends BaseService<${ClassName}> {\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @return\n     */\n    public R select${ClassName}List(Pager<${ClassName}> pager);\n\n    /**\n     * 新增或修改\n     *\n     * @param ${className}\n     * @return\n     */\n    public R insertOrUpdate(${ClassName} ${className});\n}');
INSERT INTO `gen_template` VALUES (3, 1, 'java/ServiceImpl.java.ftl', 'serviceImpl', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java', 'package ${package}.${moduleName}.service.impl;\n\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;\nimport lombok.AllArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.stereotype.Service;\n\nimport ${package}.base.common.res.BusException;\nimport ${package}.base.common.res.ExEnum;\nimport ${package}.base.common.res.R;\nimport ${package}.base.datasource.bean.Pager;\nimport ${package}.base.datasource.service.impl.BaseServiceImpl;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\n\nimport java.util.List;\n\n/**\n * 类描述 : ${tableComment}服务类\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\n@Service\n@Slf4j\n@AllArgsConstructor\npublic class ${ClassName}ServiceImpl extends BaseServiceImpl<${ClassName}Mapper, ${ClassName}> implements ${ClassName}Service {\n\n    /**\n     * ${tableComment}Maper\n     */\n    private final ${ClassName}Mapper ${className}Mapper;\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @return\n     */\n    @Override\n    public R select${ClassName}List(Pager<${ClassName}> pager){\n        pager.setRecords(${className}Mapper.select${ClassName}List(pager, pager.getDataMap()));\n        return R.ok(pager);\n    }\n    \n    /**\n     * 新增或修改\n     *\n     * @param ${className}\n     * @return\n     */\n    @Override\n    public R insertOrUpdate(${ClassName} ${className}){\n        checkExist(${className});\n        return R.ok(saveOrUpdate(${className}));\n    }\n\n    /**\n     * 验证重复\n     *\n     * @param ${className}\n     */\n    private void checkExist(${ClassName} ${className}) {\n        QueryWrapper<${ClassName}> queryWrapper = new QueryWrapper<>();\n\n        List<${ClassName}> list = list(queryWrapper);\n        if (CollUtil.isNotEmpty(list)) {\n            throw new BusException(ExEnum.SYS_PARAM_PARAM_KEY_EXISTS);\n        }\n    }\n}');
INSERT INTO `gen_template` VALUES (4, 1, 'java/Entity.java.ftl', 'entity', '${backendPath}/src/main/java/${packagePath}/${moduleName}/entity/${ClassName}.java', 'package ${package}.${moduleName}.entity;\n\nimport lombok.Data;\nimport lombok.experimental.Accessors;\nimport lombok.EqualsAndHashCode;\nimport com.baomidou.mybatisplus.annotation.*;\n<#list importList as i>\nimport ${i!};\n</#list>\n<#if baseClass??>\nimport ${baseClass.packageName}.${baseClass.code};\n</#if>\n\n/**\n * ${tableComment} 实体类\n *\n * @author ${author} ${email}\n * @since ${version} ${date}\n */\n@Data\n@Accessors(chain = true)\n@TableName(\"${tableName}\")\npublic class ${ClassName}<#if baseClass??> extends ${baseClass.code}</#if> {\n\n<#list fieldList as field>\n<#if !field.baseField>\n	/**\n	 * ${field.fieldComment}\n	 */\n    <#if field.primaryPk>\n	@TableId(<#if field.fieldName != field.attrName>value = \"${field.fieldName}\", </#if>type = IdType.AUTO)\n	<#elseif field.fieldName != field.attrName || field.autoFill != \'DEFAULT\'>\n	@TableField(<#if field.fieldName != field.attrName>value = \"${field.fieldName}\"</#if><#if field.autoFill != \'DEFAULT\'>, fill = FieldFill.${field.autoFill}</#if>)\n	</#if>\n	private ${field.attrType} ${field.attrName};\n</#if>\n\n</#list>\n}');
INSERT INTO `gen_template` VALUES (5, 1, 'java/Mapper.java.ftl', 'mapper接口', '${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java', 'package ${package}.${moduleName}.mapper;\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport com.baomidou.mybatisplus.extension.plugins.pagination.Page;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\nimport java.util.Map;\n\n\n/**\n * 类描述 : ${tableComment}\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\npublic interface ${ClassName}Mapper extends BaseMapper<${ClassName}> {\n\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @param paramMap\n     * @return\n     */\n    List<SysVersion> select${ClassName}List(Page<${ClassName}> pager, @Param(\"map\") Map paramMap);\n}');
INSERT INTO `gen_template` VALUES (6, 1, 'xml/Mapper.xml.ftl', 'mapperXML', '${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.${moduleName}.mapper.${ClassName}Mapper\">\n\n    <!-- 字段映射 -->\n    <resultMap type=\"${package}.${moduleName}.entity.${ClassName}\" id=\"${className}Map\">\n        <#list fieldList as field>\n        <!-- ${field.fieldComment} -->\n        <result column=\"${field.fieldName}\" property=\"${field.attrName}\"/>\n        </#list>\n    </resultMap>\n\n\n    <!-- 列表分页查询 -->\n    <select id=\"select${ClassName}List\"  parameterType=\"java.util.Map\" resultMap=\"${className}Map\">\n        select\n        <#list fieldList as field>\n            t.${field.fieldName}<#if field_has_next>,</#if>\n        </#list>\n        from\n            ${tableName} as t\n        <where>\n            <#list fieldList as field>\n            <#if field.attrName == \'deleteFlag\'>\n                and t.delete_flag = 1\n            <#else>\n            <#if !field.primaryPk && field.queryItem >\n            <!-- ${field.fieldComment} -->\n            <#if field.queryType == \'like\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'%\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'%\')\n            </if>\n            <#elseif field.queryType == \'left like\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'%\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'\')\n            </if>\n            <#elseif field.queryType == \'right like\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'%\')\n            </if>\n            <#else>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} ${field.queryType} <#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>\n            </if>\n            </#if>\n            </#if>\n            <#if !field.primaryPk && !field.queryItem\n                && field.attrName != \'createUser\' && field.attrName != \'createTime\' && field.attrName != \'createName\'\n                && field.attrName != \'updateUser\' && field.attrName != \'updateName\' && field.attrName != \'updateTime\'\n            >\n            <!-- ${field.fieldComment} -->\n            <#if field.attrType == \'String\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'%\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'%\')\n            </if>\n            <#else>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} = <#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>\n            </if>\n            </#if>\n            </#if>\n            </#if>\n            </#list>\n        </where>\n    </select>\n\n</mapper>');
INSERT INTO `gen_template` VALUES (7, 1, 'sql/menu.sql.ftl', '菜单SQL', '${backendPath}/menu/${functionName}_menu.sql', '<#assign dbTime = \"now()\">\n<#if dbType==\"SQLServer\">\n    <#assign dbTime = \"getDate()\">\n</#if>\n\n-- 初始化菜单\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ( 9, \'${className}\', \'${tableComment!}\', \'${className}\', 2, \'Location\', 1, \'../views/${moduleName}/${className}/index.vue\', 2, NULL, NULL, 2, 1, 1, 1, 1, 1, \'admin\', ${dbTime}, 1, \'admin\', ${dbTime});\n\n-- 菜单ID\n<#if dbType==\"SQLServer\">\nDECLARE @menuId int\n</#if>\nset @menuId = @@identity;\n\n\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'查询\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:list\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'新增\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:add\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'编辑\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:edit\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'删除\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:delete\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\n');
INSERT INTO `gen_template` VALUES (8, 1, 'vue/index.vue.ftl', '前端index', '${frontendPath}/src/views/${moduleName}/${className}/index.vue', '<template>\n	<div>\n		<t-table v-model=\"formData\" v-bind=\"config\" ref=\"table\">\n			<template #toolbar>\n				<el-button type=\"primary\" icon=\"plus\" size=\"default\" @click=\"onAdd\" v-auth=\"\'${moduleName}:${className}:add\'\">新增${tableComment}</el-button>\n			</template>\n		</t-table>\n\n		<!--新增修改弹窗-->\n		<edit v-model=\"pop${FunctionName}.visible\" :is-add=\"pop${FunctionName}.isAdd\" :item-data=\"pop${FunctionName}.itemData\" @success=\"table.onSearch()\" />\n	</div>\n</template>\n\n<script setup lang=\"jsx\" name=\"sysParam\">\n	import Edit from \'./modules/edit.vue\'\n	import { baseOperation } from \'@/utils/page\'\n\n	const formData = reactive({\n		<#list queryList as field>\n		${field.attrName}: <#if field.attrType == \'String\'>\'\',<#else >null,</#if>\n		</#list>\n	})\n	const table = ref()\n	const config = {\n		//搜索栏配置\n		searchConfig: {\n			config: [\n				<#list queryList as field>\n				<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n				{\n					label: \'${field_comment}\',\n					prop: \'${field.attrName}\',\n                    <#if field.formType == \'text\' || field.formType == \'textarea\' || field.formType == \'editor\'>\n                    slot: () => <el-input v-model={formData.${field.attrName}} placeholder=\'请输入${field_comment}\' />\n                    <#elseif field.queryFormType == \'select\' || field.queryFormType == \'radio\'>\n                    <#if field.queryDict??>\n                    slot: () => <t-dict label=\'${field.queryDict}\' v-model={formData.${field.attrName}} type=\"${field.queryFormType}\" />\n                    <#else>\n                    slot: () => <el-select v-model=\"{formData.${field.attrName}}\" placeholder=\"请输入${field_comment}\">\n                        <el-option label=\"选择\" value=\"0\"></el-option>\n                    </el-select>\n                    </#if>\n                    <#elseif field.queryFormType == \'date\'>\n                    <el-date-picker\n                        v-model=\"{formData.${field.attrName}}\"\n                        type=\"daterange\"\n                        value-format=\"yyyy-MM-dd\">\n                    </el-date-picker>\n                    <#elseif field.queryFormType == \'datetime\'>\n                    <el-date-picker\n                        v-model=\"{formData.${field.attrName}}\"\n                        type=\"datetimerange\"\n                        value-format=\"yyyy-MM-dd HH:mm:ss\">\n                    </el-date-picker>\n                    <#else>\n                    slot: () => <el-input v-model={formData.${field.attrName}} placeholder=\'请输入${field_comment}\' />\n                    </#if>\n				},\n				</#list>\n			],\n			buttonInline: true\n		},\n		//批量配置\n		batchConfig: {\n			menus: [\n				{\n					label: \'删除\',\n					icon: \'Delete\',\n					auth: \'${moduleName}:${className}:delete\',\n					onClick: row => deleteFun.run(row.map(item => item.<#list primaryList as field>${field.attrName}</#list>))\n				}\n			]\n		},\n		//表格配置\n		tableConfig: {\n			cols: [\n				<#list gridList as field>\n				<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n				{ label: \'${field_comment}\', prop: \'${field.attrName}\',align: \'center\',width: 150<#if field.queryDict??>, slot: ({ row }) => <span v-dict={{ label: \'${field.queryDict}\', value: row.${field.attrName} }} /></#if> },\n				</#list>\n				{\n					label: \'操作\',\n					align: \'center\', \n					slot: ({ row }) => {\n						return (\n								<>\n									<el-button size=\'small\' type=\'primary\' onClick={() => onEdit(row)} v-auth={\'${moduleName}:${className}:edit\'}>\n										编辑\n									</el-button>\n									<el-button size=\'small\' type=\'danger\' onClick={() => deleteFun.run(row.paramId)} v-auth={\'${moduleName}:${className}:delete\'}>\n										删除\n									</el-button>\n								</>\n						)\n					}\n				}\n			],\n			colIgnoreList: [\'操作\']\n		},\n		//获取数据的地址\n		request: \'/${moduleName}/${className}/list\'\n	}\n	//新增修改弹窗的参数\n	const pop${FunctionName} = reactive({\n		//是否是新增\n		isAdd: true,\n		//弹窗显示隐藏\n		visible: false,\n		//编辑的时候传递给子组件的行数据\n		itemData: null\n	})\n\n	/**\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * 新增\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onAdd() {\n		pop${FunctionName}.isAdd = true\n		pop${FunctionName}.visible = true\n	}\n\n	/**\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * 编辑\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onEdit(row) {\n		pop${FunctionName}.isAdd = false\n		pop${FunctionName}.itemData = row\n		pop${FunctionName}.visible = true\n	}\n\n	/**\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * 删除\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * **/\n	const deleteFun = new baseOperation(\'/${moduleName}/${className}/delete\', \'删除\', () => table.value.onSearch())\n</script>\n');
INSERT INTO `gen_template` VALUES (9, 1, 'vue/edit.vue.ftl', '前端编辑页面', '${frontendPath}/src/views/${moduleName}/${className}/modules/edit.vue', '<template>\n	<el-drawer v-model=\"visible\" :title=\"!formData.id ? \'新增\' : \'修改\'\" @closed=\"onClosed\" @opened=\"onOpened\">\n		<el-form ref=\"formRef\" :model=\"formData\" :rules=\"formRules\" label-width=\"130px\" >\n	<#list formList as field>\n		<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n		<#if field.formType == \'text\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input v-model=\"formData.${field.attrName}\" placeholder=\"${field_comment}\"></el-input>\n			</el-form-item>\n		<#elseif field.formType == \'textarea\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input type=\"textarea\" v-model=\"formData.${field.attrName}\"></el-input>\n			</el-form-item>\n		<#elseif field.formType == \'editor\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input type=\"textarea\" v-model=\"formData.${field.attrName}\"></el-input>\n			</el-form-item>\n		<#elseif field.formType == \'select\' ||  field.formType == \'radio\' ||  field.formType == \'checkbox\'>\n			<#if field.queryDict??>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<t-dict label=\'${field.queryDict}\' v-model=formData.${field.attrName} type=\"${field.queryFormType}\" />\n			</el-form-item>\n			<#else>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-select v-model=\"formData.${field.attrName}\" placeholder=\"请输入${field_comment}\">\n					<el-option label=\"选择\" value=\"0\"></el-option>\n				</el-select>\n			</el-form-item>\n			</#if>\n		<#elseif field.formType == \'date\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-date-picker type=\"date\" placeholder=\"${field_comment}\" v-model=\"formData.${field.attrName}\"></el-date-picker>\n			</el-form-item>\n		<#elseif field.formType == \'datetime\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-date-picker type=\"datetime\" placeholder=\"${field_comment}\" v-model=\"formData.${field.attrName}\"></el-date-picker>\n			</el-form-item>\n		<#else>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input v-model=\"formData.${field.attrName}\" placeholder=\"${field_comment}\"></el-input>\n			</el-form-item>\n		</#if>\n	</#list>\n		</el-form>\n		<template #footer>\n			<el-button @click=\"visible = false\">取消</el-button>\n			<el-button type=\"primary\" v-if=\"props.isAdd\" :loading=\"addLoading\" @click=\"addHandle\">新增</el-button>\n			<el-button type=\"primary\" v-else :loading=\"updateLoading\" @click=\"updateHandle\">修改</el-button>\n		</template>\n	</el-drawer>\n</template>\n\n<script setup name=\"Edit${ClassName}\">\n	import { useVModel } from \'@vueuse/core\'\n	import omit from \'lodash.omit\'\n	import { ElMessage } from \'element-plus\'\n\n	const props = defineProps({\n		modelValue: Boolean,\n		isAdd: Boolean,\n		itemData: {\n			type: Object,\n			default: () => ({})\n		}\n	})\n	const formRef = ref()\n	const emit = defineEmits([\'update:modelValue\', \'success\'])\n	//弹窗显示隐藏\n	const visible = useVModel(props, \'modelValue\', emit)\n	//表单数据\n	const formData = reactive({\n		<#list formList as field>\n		${field.attrName}: <#if field.attrType == \'String\'>\'\',<#else >null,</#if>\n		</#list>\n		<#list primaryList as field>${field.attrName}:null</#list>\n	})\n	//表单校验规则\n	const formRules = {\n		<#list formList as field>\n		<#if field.formRequired >\n		<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n		${field.attrName}: { required: true, message: \'请输入${field_comment}\' },\n		</#if>\n		</#list>\n	}\n	//新增\n	const addParams = computed(() => {\n		return {\n			url: \'/${moduleName}/${className}/add\',\n			method: \'post\',\n			data: omit(formData, [\'paramId\'])\n		}\n	})\n	const { run: addRun, loading: addLoading } = useRequest(http, {\n		manual: true,\n		onSuccess() {\n			ElMessage({\n				message: \'新增成功\',\n				type: \'success\'\n			})\n			emit(\'success\')\n			visible.value = false\n		}\n	})\n	//修改\n	const updateParams = computed(() => {\n		return {\n			url: \'/${moduleName}/${className}/edit\',\n			method: \'post\',\n			data: formData\n		}\n	})\n	const { run: updateRun, loading: updateLoading } = useRequest(http, {\n		manual: true,\n		onSuccess() {\n			ElMessage({\n				message: \'修改成功\',\n				type: \'success\'\n			})\n			emit(\'success\')\n			visible.value = false\n		}\n	})\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 弹窗打开\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onOpened() {\n		if (props.isAdd || !props.itemData) return\n		//如果是编辑模式，则把值赋给formData\n		for (let key in formData) {\n			formData[key] = props.itemData[key]\n		}\n	}\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 弹窗关闭\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onClosed() {\n		formRef.value.resetFields()\n		setTimeout(() => formRef.value.clearValidate(), 500)\n	}\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 新增\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function addHandle() {\n		formRef.value.validate(valid => {\n			if (!valid) return\n			addRun(addParams.value)\n		})\n	}\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 修改\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function updateHandle() {\n		formRef.value.validate(valid => {\n			if (!valid) return\n			updateRun(updateParams.value)\n		})\n	}\n</script>');
INSERT INTO `gen_template` VALUES (10, 2, 'java/Controller.java.ftl', 'controller', '${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java', 'controller');
INSERT INTO `gen_template` VALUES (14, 2, 'config.json', 'config', 'config.json', '<#list fieldList as field>\n\n\n</#list>\n\n  \n    ');
INSERT INTO `gen_template` VALUES (15, 2, 'Controller.java.ftl', 'Controller', '${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java', 'package ${package}.${moduleName}.controller;\n\nimport lombok.AllArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport cn.dev33.satoken.annotation.SaCheckPermission;\nimport com.xlauch.base.common.controller.BaseController;\nimport com.xlauch.base.common.res.R;\nimport com.xlauch.base.common.vo.Ids;\nimport com.xlauch.base.datasource.bean.Pager;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n\n/**\n* 类描述 : ${tableComment}\n*\n* @author ${author}\n* @version ${version}\n* @since ${date}\n*/\n@Slf4j\n@RestController\n@RequestMapping(\"${moduleName}/${className}\")\n@AllArgsConstructor\npublic class ${ClassName}Controller extends BaseController {\n\n    /**\n     * ${tableComment}服务类\n     */\n    private final ${ClassName}Service ${className}Service;\n\n    /**\n     * 分页查询\n     *\n     * @param pager 分页信息\n     * @return\n     */\n    @PostMapping(\"/list\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:list\")\n    public R list(Pager pager) {\n        return ${className}Service.select${ClassName}List(pager);\n    }\n\n    /**\n     * 新增\n     *\n     * @param ${className} ${tableComment}实体类\n     * @return\n     */\n    @PostMapping(\"/add\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:add\")\n    public R add(@RequestBody ${ClassName} ${className}) {\n        return ${className}Service.insertOrUpdate(${className});\n    }\n\n    /**\n     * 修改\n     *\n     * @param ${className} ${tableComment}实体类\n     * @return\n     */\n    @PostMapping(\"/edit\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:edit\")\n    public R edit(@RequestBody ${ClassName} ${className}) {\n        return ${className}Service.insertOrUpdate(${className});\n    }\n\n    /**\n     * 删除\n     *\n     * @param ids 存放要删除的对象id\n     * @return\n     */\n    @PostMapping(\"/delete\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:delete\")\n    public R delete(@RequestBody Ids ids) {\n        return R.ok(${className}Service.removeBatchByIds(ids.getIdList()));\n    }\n\n}');
INSERT INTO `gen_template` VALUES (16, 2, 'java/Service.java.ftl', 'service', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java', 'package ${package}.${moduleName}.service;\n\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.base.common.res.R;\nimport ${package}.base.datasource.bean.Pager;\nimport ${package}.base.datasource.service.BaseService;\n\n\n/**\n * 类描述 : ${tableComment}服务类接口\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\npublic interface ${ClassName}Service extends BaseService<${ClassName}> {\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @return\n     */\n    public R select${ClassName}List(Pager<${ClassName}> pager);\n\n    /**\n     * 新增或修改\n     *\n     * @param ${className}\n     * @return\n     */\n    public R insertOrUpdate(${ClassName} ${className});\n}');
INSERT INTO `gen_template` VALUES (17, 2, 'java/ServiceImpl.java.ftl', 'serviceImpl', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/impl/${ClassName}ServiceImpl.java', 'package ${package}.${moduleName}.service.impl;\n\nimport cn.hutool.core.collection.CollUtil;\nimport com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;\nimport lombok.AllArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport org.springframework.stereotype.Service;\n\nimport ${package}.base.common.res.BusException;\nimport ${package}.base.common.res.ExEnum;\nimport ${package}.base.common.res.R;\nimport ${package}.base.datasource.bean.Pager;\nimport ${package}.base.datasource.service.impl.BaseServiceImpl;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.${moduleName}.mapper.${ClassName}Mapper;\nimport ${package}.${moduleName}.service.${ClassName}Service;\n\nimport java.util.List;\n\n/**\n * 类描述 : ${tableComment}服务类\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\n@Service\n@Slf4j\n@AllArgsConstructor\npublic class ${ClassName}ServiceImpl extends BaseServiceImpl<${ClassName}Mapper, ${ClassName}> implements ${ClassName}Service {\n\n    /**\n     * ${tableComment}Maper\n     */\n    private final ${ClassName}Mapper ${className}Mapper;\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @return\n     */\n    @Override\n    public R select${ClassName}List(Pager<${ClassName}> pager){\n        pager.setRecords(${className}Mapper.select${ClassName}List(pager, pager.getDataMap()));\n        return R.ok(pager);\n    }\n    \n    /**\n     * 新增或修改\n     *\n     * @param ${className}\n     * @return\n     */\n    @Override\n    public R insertOrUpdate(${ClassName} ${className}){\n        checkExist(${className});\n        return R.ok(saveOrUpdate(${className}));\n    }\n\n    /**\n     * 验证重复\n     *\n     * @param ${className}\n     */\n    private void checkExist(${ClassName} ${className}) {\n        QueryWrapper<${ClassName}> queryWrapper = new QueryWrapper<>();\n\n        List<${ClassName}> list = list(queryWrapper);\n        if (CollUtil.isNotEmpty(list)) {\n            throw new BusException(ExEnum.SYS_PARAM_PARAM_KEY_EXISTS);\n        }\n    }\n}');
INSERT INTO `gen_template` VALUES (18, 2, 'java/Entity.java.ftl', 'entity', '${backendPath}/src/main/java/${packagePath}/${moduleName}/entity/${ClassName}.java', 'package ${package}.${moduleName}.entity;\n\nimport lombok.Data;\nimport lombok.experimental.Accessors;\nimport lombok.EqualsAndHashCode;\nimport com.baomidou.mybatisplus.annotation.*;\n<#list importList as i>\nimport ${i!};\n</#list>\n<#if baseClass??>\nimport ${baseClass.packageName}.${baseClass.code};\n</#if>\n\n/**\n * ${tableComment} 实体类\n *\n * @author ${author} ${email}\n * @since ${version} ${date}\n */\n@Data\n@Accessors(chain = true)\n@TableName(\"${tableName}\")\npublic class ${ClassName}<#if baseClass??> extends ${baseClass.code}</#if> {\n\n<#list fieldList as field>\n<#if !field.baseField>\n	/**\n	 * ${field.fieldComment}\n	 */\n    <#if field.primaryPk>\n	@TableId(<#if field.fieldName != field.attrName>value = \"${field.fieldName}\", </#if>type = IdType.AUTO)\n	<#elseif field.fieldName != field.attrName || field.autoFill != \'DEFAULT\'>\n	@TableField(<#if field.fieldName != field.attrName>value = \"${field.fieldName}\"</#if><#if field.autoFill != \'DEFAULT\'>, fill = FieldFill.${field.autoFill}</#if>)\n	</#if>\n	private ${field.attrType} ${field.attrName};\n</#if>\n\n</#list>\n}');
INSERT INTO `gen_template` VALUES (19, 2, 'java/Mapper.java.ftl', 'mapper接口', '${backendPath}/src/main/java/${packagePath}/${moduleName}/mapper/${ClassName}Mapper.java', 'package ${package}.${moduleName}.mapper;\n\nimport com.baomidou.mybatisplus.core.mapper.BaseMapper;\nimport com.baomidou.mybatisplus.extension.plugins.pagination.Page;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport org.apache.ibatis.annotations.Param;\n\nimport java.util.List;\nimport java.util.Map;\n\n\n/**\n * 类描述 : ${tableComment}\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\npublic interface ${ClassName}Mapper extends BaseMapper<${ClassName}> {\n\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @param paramMap\n     * @return\n     */\n    List<SysVersion> select${ClassName}List(Page<${ClassName}> pager, @Param(\"map\") Map paramMap);\n}');
INSERT INTO `gen_template` VALUES (20, 2, 'xml/Mapper.xml.ftl', 'mapperXML', '${backendPath}/src/main/resources/mapper/${ClassName}Mapper.xml', '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n\n<mapper namespace=\"${package}.${moduleName}.mapper.${ClassName}Mapper\">\n\n    <!-- 字段映射 -->\n    <resultMap type=\"${package}.${moduleName}.entity.${ClassName}\" id=\"${className}Map\">\n        <#list fieldList as field>\n        <!-- ${field.fieldComment} -->\n        <result column=\"${field.fieldName}\" property=\"${field.attrName}\"/>\n        </#list>\n    </resultMap>\n\n\n    <!-- 列表分页查询 -->\n    <select id=\"select${ClassName}List\"  parameterType=\"java.util.Map\" resultMap=\"${className}Map\">\n        select\n        <#list fieldList as field>\n            t.${field.fieldName}<#if field_has_next>,</#if>\n        </#list>\n        from\n            ${tableName} as t\n        <where>\n            <#list fieldList as field>\n            <#if field.attrName == \'deleteFlag\'>\n                and t.delete_flag = 1\n            <#else>\n            <#if !field.primaryPk && field.queryItem >\n            <!-- ${field.fieldComment} -->\n            <#if field.queryType == \'like\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'%\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'%\')\n            </if>\n            <#elseif field.queryType == \'left like\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'%\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'\')\n            </if>\n            <#elseif field.queryType == \'right like\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'%\')\n            </if>\n            <#else>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} ${field.queryType} <#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>\n            </if>\n            </#if>\n            </#if>\n            <#if !field.primaryPk && !field.queryItem\n                && field.attrName != \'createUser\' && field.attrName != \'createTime\' && field.attrName != \'createName\'\n                && field.attrName != \'updateUser\' && field.attrName != \'updateName\' && field.attrName != \'updateTime\'\n            >\n            <!-- ${field.fieldComment} -->\n            <#if field.attrType == \'String\'>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} like concat(\'%\',<#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>, \'%\')\n            </if>\n            <#else>\n            <if test=\"map.${field.attrName} != null and map.${field.attrName} != \'\'\">\n                and t.${field.fieldName} = <#noparse>#{</#noparse>map.${field.attrName}<#noparse>}</#noparse>\n            </if>\n            </#if>\n            </#if>\n            </#if>\n            </#list>\n        </where>\n    </select>\n\n</mapper>');
INSERT INTO `gen_template` VALUES (21, 2, 'sql/menu.sql.ftl', '菜单SQL', '${backendPath}/menu/${functionName}_menu.sql', '<#assign dbTime = \"now()\">\n<#if dbType==\"SQLServer\">\n    <#assign dbTime = \"getDate()\">\n</#if>\n\n-- 初始化菜单\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ( 9, \'${className}\', \'${tableComment!}\', \'${className}\', 2, \'Location\', 1, \'../views/${moduleName}/${className}/index.vue\', 2, NULL, NULL, 2, 1, 1, 1, 1, 1, \'admin\', ${dbTime}, 1, \'admin\', ${dbTime});\n\n-- 菜单ID\n<#if dbType==\"SQLServer\">\nDECLARE @menuId int\n</#if>\nset @menuId = @@identity;\n\n\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'查询\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:list\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'新增\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:add\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'编辑\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:edit\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\nINSERT INTO `t_sys_menu`( `parent_id`, `menu_name`, `title`, `path`, `type`, `icon`, `component_type`, `component`, `is_out_link`, `grant_code`, `url`, `hidden`, `seq`, `cache`, `buss_status`, `delete_flag`, `create_user`, `create_name`, `create_time`, `update_user`, `update_name`, `update_time`) VALUES ((SELECT @menuId), NULL, \'删除\', NULL, 3, NULL, NULL, NULL, 2, \'${moduleName}:${className}:delete\', NULL, NULL, NULL, NULL, 1, 2, 1, \'admin\', ${dbTime}, NULL, \'0\', NULL);\n');
INSERT INTO `gen_template` VALUES (22, 2, 'vue/index.vue.ftl', '前端index', '${frontendPath}/src/views/${moduleName}/${className}/index.vue', '<template>\n	<div>\n		<t-table v-model=\"formData\" v-bind=\"config\" ref=\"table\">\n			<template #toolbar>\n				<el-button type=\"primary\" icon=\"plus\" size=\"default\" @click=\"onAdd\" v-auth=\"\'${moduleName}:${className}:add\'\">新增${tableComment}</el-button>\n			</template>\n		</t-table>\n\n		<!--新增修改弹窗-->\n		<edit v-model=\"pop${FunctionName}.visible\" :is-add=\"pop${FunctionName}.isAdd\" :item-data=\"pop${FunctionName}.itemData\" @success=\"table.onSearch()\" />\n	</div>\n</template>\n\n<script setup lang=\"jsx\" name=\"sysParam\">\n	import Edit from \'./modules/edit.vue\'\n	import { baseOperation } from \'@/utils/page\'\n\n	const formData = reactive({\n		<#list queryList as field>\n		${field.attrName}: <#if field.attrType == \'String\'>\'\',<#else >null,</#if>\n		</#list>\n	})\n	const table = ref()\n	const config = {\n		//搜索栏配置\n		searchConfig: {\n			config: [\n				<#list queryList as field>\n				<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n				{\n					label: \'${field_comment}\',\n					prop: \'${field.attrName}\',\n                    <#if field.formType == \'text\' || field.formType == \'textarea\' || field.formType == \'editor\'>\n                    slot: () => <el-input v-model={formData.${field.attrName}} placeholder=\'请输入${field_comment}\' />\n                    <#elseif field.queryFormType == \'select\' || field.queryFormType == \'radio\'>\n                    <#if field.queryDict??>\n                    slot: () => <t-dict label=\'${field.queryDict}\' v-model={formData.${field.attrName}} type=\"${field.queryFormType}\" />\n                    <#else>\n                    slot: () => <el-select v-model=\"{formData.${field.attrName}}\" placeholder=\"请输入${field_comment}\">\n                        <el-option label=\"选择\" value=\"0\"></el-option>\n                    </el-select>\n                    </#if>\n                    <#elseif field.queryFormType == \'date\'>\n                    <el-date-picker\n                        v-model=\"{formData.${field.attrName}}\"\n                        type=\"daterange\"\n                        value-format=\"yyyy-MM-dd\">\n                    </el-date-picker>\n                    <#elseif field.queryFormType == \'datetime\'>\n                    <el-date-picker\n                        v-model=\"{formData.${field.attrName}}\"\n                        type=\"datetimerange\"\n                        value-format=\"yyyy-MM-dd HH:mm:ss\">\n                    </el-date-picker>\n                    <#else>\n                    slot: () => <el-input v-model={formData.${field.attrName}} placeholder=\'请输入${field_comment}\' />\n                    </#if>\n				},\n				</#list>\n			],\n			buttonInline: true\n		},\n		//批量配置\n		batchConfig: {\n			menus: [\n				{\n					label: \'删除\',\n					icon: \'Delete\',\n					auth: \'${moduleName}:${className}:delete\',\n					onClick: row => deleteFun.run(row.map(item => item.<#list primaryList as field>${field.attrName}</#list>))\n				}\n			]\n		},\n		//表格配置\n		tableConfig: {\n			cols: [\n				<#list gridList as field>\n				<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n				{ label: \'${field_comment}\', prop: \'${field.attrName}\',align: \'center\',width: 150<#if field.queryDict??>, slot: ({ row }) => <span v-dict={{ label: \'${field.queryDict}\', value: row.${field.attrName} }} /></#if> },\n				</#list>\n				{\n					label: \'操作\',\n					align: \'center\',\n					width: 150,\n					slot: ({ row }) => {\n						return (\n								<>\n									<el-button size=\'small\' type=\'primary\' onClick={() => onEdit(row)} v-auth={\'${moduleName}:${className}:edit\'}>\n										编辑\n									</el-button>\n									<el-button size=\'small\' type=\'danger\' onClick={() => deleteFun.run(row.paramId)} v-auth={\'${moduleName}:${className}:delete\'}>\n										删除\n									</el-button>\n								</>\n						)\n					}\n				}\n			],\n			colIgnoreList: [\'操作\']\n		},\n		//获取数据的地址\n		request: \'/${moduleName}/${className}/list\'\n	}\n	//新增修改弹窗的参数\n	const pop${FunctionName} = reactive({\n		//是否是新增\n		isAdd: true,\n		//弹窗显示隐藏\n		visible: false,\n		//编辑的时候传递给子组件的行数据\n		itemData: null\n	})\n\n	/**\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * 新增\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onAdd() {\n		pop${FunctionName}.isAdd = true\n		pop${FunctionName}.visible = true\n	}\n\n	/**\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * 编辑\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onEdit(row) {\n		pop${FunctionName}.isAdd = false\n		pop${FunctionName}.itemData = row\n		pop${FunctionName}.visible = true\n	}\n\n	/**\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * 删除\n	 * +++++++++++++++++++++++++++++++++++++++\n	 * **/\n	const deleteFun = new baseOperation(\'/${moduleName}/${className}/delete\', \'删除\', () => table.value.onSearch())\n</script>\n');
INSERT INTO `gen_template` VALUES (23, 2, 'vue/edit.vue.ftl', '前端编辑页面', '${frontendPath}/src/views/${moduleName}/${className}/modules/edit.vue', '<template>\n	<el-drawer v-model=\"visible\" :title=\"!formData.id ? \'新增\' : \'修改\'\" @closed=\"onClosed\" @opened=\"onOpened\">\n		<el-form ref=\"formRef\" :model=\"formData\" :rules=\"formRules\" label-width=\"130px\" >\n	<#list formList as field>\n		<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n		<#if field.formType == \'text\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input v-model=\"formData.${field.attrName}\" placeholder=\"${field_comment}\"></el-input>\n			</el-form-item>\n		<#elseif field.formType == \'textarea\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input type=\"textarea\" v-model=\"formData.${field.attrName}\"></el-input>\n			</el-form-item>\n		<#elseif field.formType == \'editor\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input type=\"textarea\" v-model=\"formData.${field.attrName}\"></el-input>\n			</el-form-item>\n		<#elseif field.formType == \'select\' ||  field.formType == \'radio\' ||  field.formType == \'checkbox\'>\n			<#if field.queryDict??>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<t-dict label=\'${field.queryDict}\' v-model=formData.${field.attrName} type=\"${field.queryFormType}\" />\n			</el-form-item>\n			<#else>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-select v-model=\"formData.${field.attrName}\" placeholder=\"请输入${field_comment}\">\n					<el-option label=\"选择\" value=\"0\"></el-option>\n				</el-select>\n			</el-form-item>\n			</#if>\n		<#elseif field.formType == \'date\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-date-picker type=\"date\" placeholder=\"${field_comment}\" v-model=\"formData.${field.attrName}\"></el-date-picker>\n			</el-form-item>\n		<#elseif field.formType == \'datetime\'>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-date-picker type=\"datetime\" placeholder=\"${field_comment}\" v-model=\"formData.${field.attrName}\"></el-date-picker>\n			</el-form-item>\n		<#else>\n			<el-form-item label=\"${field_comment}\" prop=\"${field.attrName}\">\n				<el-input v-model=\"formData.${field.attrName}\" placeholder=\"${field_comment}\"></el-input>\n			</el-form-item>\n		</#if>\n	</#list>\n		</el-form>\n		<template #footer>\n			<el-button @click=\"visible = false\">取消</el-button>\n			<el-button type=\"primary\" v-if=\"props.isAdd\" :loading=\"addLoading\" @click=\"addHandle\">新增</el-button>\n			<el-button type=\"primary\" v-else :loading=\"updateLoading\" @click=\"updateHandle\">修改</el-button>\n		</template>\n	</el-drawer>\n</template>\n\n<script setup name=\"Edit${ClassName}\">\n	import { useVModel } from \'@vueuse/core\'\n	import omit from \'lodash.omit\'\n	import { ElMessage } from \'element-plus\'\n\n	const props = defineProps({\n		modelValue: Boolean,\n		isAdd: Boolean,\n		itemData: {\n			type: Object,\n			default: () => ({})\n		}\n	})\n	const formRef = ref()\n	const emit = defineEmits([\'update:modelValue\', \'success\'])\n	//弹窗显示隐藏\n	const visible = useVModel(props, \'modelValue\', emit)\n	//表单数据\n	const formData = reactive({\n		<#list formList as field>\n		${field.attrName}: <#if field.attrType == \'String\'>\'\',<#else >null,</#if>\n		</#list>\n		<#list primaryList as field>${field.attrName}:null</#list>\n	})\n	//表单校验规则\n	const formRules = {\n		<#list formList as field>\n		<#if field.formRequired >\n		<#assign field_comment = field.fieldComment?split(\",\")[0]?split(\" \")[0]?split(\"，\")[0]?split(\"（\")[0]?split(\"(\")[0] >\n		${field.attrName}: { required: true, message: \'请输入${field_comment}\' },\n		</#if>\n		</#list>\n	}\n	//新增\n	const addParams = computed(() => {\n		return {\n			url: \'/${moduleName}/${className}/add\',\n			method: \'post\',\n			data: omit(formData, [\'paramId\'])\n		}\n	})\n	const { run: addRun, loading: addLoading } = useRequest(http, {\n		manual: true,\n		onSuccess() {\n			ElMessage({\n				message: \'新增成功\',\n				type: \'success\'\n			})\n			emit(\'success\')\n			visible.value = false\n		}\n	})\n	//修改\n	const updateParams = computed(() => {\n		return {\n			url: \'/${moduleName}/${className}/edit\',\n			method: \'post\',\n			data: formData\n		}\n	})\n	const { run: updateRun, loading: updateLoading } = useRequest(http, {\n		manual: true,\n		onSuccess() {\n			ElMessage({\n				message: \'修改成功\',\n				type: \'success\'\n			})\n			emit(\'success\')\n			visible.value = false\n		}\n	})\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 弹窗打开\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onOpened() {\n		if (props.isAdd || !props.itemData) return\n		//如果是编辑模式，则把值赋给formData\n		for (let key in formData) {\n			formData[key] = props.itemData[key]\n		}\n	}\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 弹窗关闭\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function onClosed() {\n		formRef.value.resetFields()\n		setTimeout(() => formRef.value.clearValidate(), 500)\n	}\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 新增\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function addHandle() {\n		formRef.value.validate(valid => {\n			if (!valid) return\n			addRun(addParams.value)\n		})\n	}\n\n	/**\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * 修改\n	 * ++++++++++++++++++++++++++++++++++++++++\n	 * **/\n	function updateHandle() {\n		formRef.value.validate(valid => {\n			if (!valid) return\n			updateRun(updateParams.value)\n		})\n	}\n</script>');
INSERT INTO `gen_template` VALUES (45, 15, 'Controller.java.ftl', 'Controller', '${backendPath}/src/main/java/${packagePath}/${moduleName}/controller/${ClassName}Controller.java', 'package ${package}.${moduleName}.controller;\n\nimport lombok.AllArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.${moduleName}.service.${ClassName}Service;\nimport cn.dev33.satoken.annotation.SaCheckPermission;\nimport com.xlauch.base.common.controller.BaseController;\nimport com.xlauch.base.common.res.R;\nimport com.xlauch.base.common.vo.Ids;\nimport com.xlauch.base.datasource.bean.Pager;\nimport org.springframework.web.bind.annotation.*;\n\nimport java.util.List;\n\n/**\n* 类描述 : ${tableComment}\n*\n* @author ${author}\n* @version ${version}\n* @since ${date}\n*/\n@Slf4j\n@RestController\n@RequestMapping(\"${moduleName}/${className}\")\n@AllArgsConstructor\npublic class ${ClassName}Controller extends BaseController {\n\n    /**\n     * ${tableComment}服务类\n     */\n    private final ${ClassName}Service ${className}Service;\n\n    /**\n     * 分页查询\n     *\n     * @param pager 分页信息\n     * @return\n     */\n    @PostMapping(\"/list\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:list\")\n    public R list(Pager pager) {\n        return ${className}Service.select${ClassName}List(pager);\n    }\n\n    /**\n     * 新增\n     *\n     * @param ${className} ${tableComment}实体类\n     * @return\n     */\n    @PostMapping(\"/add\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:add\")\n    public R add(@RequestBody ${ClassName} ${className}) {\n        return ${className}Service.insertOrUpdate(${className});\n    }\n\n    /**\n     * 修改\n     *\n     * @param ${className} ${tableComment}实体类\n     * @return\n     */\n    @PostMapping(\"/edit\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:edit\")\n    public R edit(@RequestBody ${ClassName} ${className}) {\n        return ${className}Service.insertOrUpdate(${className});\n    }\n\n    /**\n     * 删除\n     *\n     * @param ids 存放要删除的对象id\n     * @return\n     */\n    @PostMapping(\"/delete\")\n    @SaCheckPermission(value = \"${moduleName}:${className}:delete\")\n    public R delete(@RequestBody Ids ids) {\n        return R.ok(${className}Service.removeBatchByIds(ids.getIdList()));\n    }\n\n}');
INSERT INTO `gen_template` VALUES (46, 15, 'java/Service.java.ftl', 'service', '${backendPath}/src/main/java/${packagePath}/${moduleName}/service/${ClassName}Service.java', 'package ${package}.${moduleName}.service;\n\nimport ${package}.${moduleName}.entity.${ClassName};\nimport ${package}.base.common.res.R;\nimport ${package}.base.datasource.bean.Pager;\nimport ${package}.base.datasource.service.BaseService;\n\n\n/**\n * 类描述 : ${tableComment}服务类接口\n *\n * @author ${author}\n * @version ${version}\n * @since ${date}\n */\npublic interface ${ClassName}Service extends BaseService<${ClassName}> {\n\n    /**\n     * 列表分页查询\n     *\n     * @param pager\n     * @return\n     */\n    public R select${ClassName}List(Pager<${ClassName}> pager);\n\n    /**\n     * 新增或修改\n     *\n     * @param ${className}\n     * @return\n     */\n    public R insertOrUpdate(${ClassName} ${className});\n}');

-- ----------------------------
-- Table structure for gen_template_group
-- ----------------------------
DROP TABLE IF EXISTS `gen_template_group`;
CREATE TABLE `gen_template_group`  (
  `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `group_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分组名称',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Records of gen_template_group
-- ----------------------------
INSERT INTO `gen_template_group` VALUES (1, 'xlauch');
INSERT INTO `gen_template_group` VALUES (2, 'cloud');
INSERT INTO `gen_template_group` VALUES (15, '123');

SET FOREIGN_KEY_CHECKS = 1;
